package com.jy.wms.service;

import com.google.gson.JsonParser;
import com.joyi.gate.comm.SessionInfo;
import com.joyi.gate.safety.vo.UserInfo;
import com.jy.wms.common.UUIDUtils;
import com.jy.wms.common.base.*;
import com.jy.wms.dao.YofotoMapper;
import com.jy.wms.pojo.*;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.text.SimpleDateFormat;
import java.util.*;

/**
 * @ClassName: UserController
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @Author syh
 * @Date 2018/9/13
 */
@Service
public class YofotoService extends BaseService<YofotoMapper,WmsShipmentOrder> {

    //<!-----------------------承运商选择-------------------------->
    public JSONObject getForwardingAgent(String fybh){
        /*
        快递公司	条件
        1中邮EMS	    三公斤以下所有
                    3-20公斤 山西、内蒙古、河南、河北、北京
                    21-50公斤 河南、河北
        2中通快递	3-20公斤 山东、天津
                    21-50公斤 天津
        3百世物流	北京20公斤以上
                    山东21-40公斤
                    21-50公斤 山西、内蒙
        4佳怡物流	山东40以上
                    除北京外50公斤以上
        */
        JSONObject allJson = new JSONObject();

        //计算每个单子的重量
        WmsShipmentOrder wmsShipmentOrder=dao.sumZl(fybh);
        //中邮(发货地区)
        String[] s11 = {"山西省","内蒙古","河南省","河北省","北京市"};
        String[] s12 = {"河南省","河北省"};
        //申通(发货地区)
        String[] s21 = {"山东省","天津市"};
        String[] s22 = {"天津市"};
        //百世(发货地区)
        String[] s31 = {"北京市"};
        String[] s32 = {"山东省","北京市"};
        String[] s33 = {"山西省","内蒙古","北京市"};
        //佳怡(发货地区)
        String[] s41 = {"山东省"};
        //佳怡(不到地区)
        String[] s42 = {"北京市"};
        String sheng = wmsShipmentOrder.getSheng();
        String shi= wmsShipmentOrder.getShi();
        String qu = wmsShipmentOrder.getXq();
        if(wmsShipmentOrder.getZzl()<=3){
            //三公斤以下所有(中邮EMS)
            wmsShipmentOrder.setCyslb("1");
        }else if(wmsShipmentOrder.getZzl()>3 && wmsShipmentOrder.getZzl()<=20){
            //3-20公斤 山西、内蒙古、河南、河北、北京(中邮EMS);3-20公斤 山东、天津(中通快递)
            if(Arrays.asList(s11).contains(sheng)){
                wmsShipmentOrder.setCyslb("1");
            }else if(Arrays.asList(s21).contains(sheng)){
                wmsShipmentOrder.setCyslb("2");
            }
        }else if(wmsShipmentOrder.getZzl()>=21 && wmsShipmentOrder.getZzl()<=40){
            if(Arrays.asList(s12).contains(sheng)){
                wmsShipmentOrder.setCyslb("1");
            }else if(Arrays.asList(s22).contains(sheng)){
                wmsShipmentOrder.setCyslb("2");
            }else if(Arrays.asList(s32).contains(sheng)){
                wmsShipmentOrder.setCyslb("3");
            }else if(Arrays.asList(s33).contains(sheng)){
                wmsShipmentOrder.setCyslb("3");
            }
        }else if(wmsShipmentOrder.getZzl()>=40 && wmsShipmentOrder.getZzl()<=50){
            if(Arrays.asList(s12).contains(sheng)){
                wmsShipmentOrder.setCyslb("1");
            }else if(Arrays.asList(s22).contains(sheng)){
                wmsShipmentOrder.setCyslb("2");
            }else if(Arrays.asList(s33).contains(sheng)){
                wmsShipmentOrder.setCyslb("3");
            }else if(Arrays.asList(s41).contains(sheng)){
                wmsShipmentOrder.setCyslb("4");
            }
        }else if(wmsShipmentOrder.getZzl()>20 && wmsShipmentOrder.getZzl()<21){
            if(Arrays.asList(s31).contains(sheng)){
                wmsShipmentOrder.setCyslb("3");
            }
        }else if(wmsShipmentOrder.getZzl()>50){
            if(!Arrays.asList(s42).contains(sheng)){
                wmsShipmentOrder.setCyslb("4");
            }
        }
        allJson.put("cyslb",wmsShipmentOrder.getCyslb());
        return allJson;
    }
    /**
     * 根据发运编号修改承运商类别
     * */
    public Integer updateCyslb(WmsShipmentOrder wmsShipmentOrder){return dao.updateCyslb(wmsShipmentOrder);}
    //<!-----------------------被动提供接口-------------------------->
    /**
     * 出库单修改
     * */
    public WmsShipmentOrder getselect(String sono,String works){
        return  dao.getSelect(sono, works);
    }

    /**
     * 查看复核表 判断是否复核完成
     * */
    public Integer selectReview(){
        return dao.selectReview();
    }

    /**
     * 出库订单修改接口
     *
     * */
    public Integer getUpdate(WmsShipmentOrder wmsShipmentOrder){return  dao.getUpdate(wmsShipmentOrder);}

    /**
     * 查询发运订单 判断是否是发运之前
     * */
    public WmsShipmentOrder selectFy(WmsShipmentOrder wmsShipmentOrder){return dao.selectFy(wmsShipmentOrder);}

    /**
     * 销售出库单取消
     * */
    public Integer getDelete(String sono){return dao.getDelete(sono);}

    /**
     * 销售出库单下发接口
     * */
    @Transactional
    public void addFy(JSONObject map) throws Exception {
        WmsShipmentOrder wmsShipmentOrder=new WmsShipmentOrder();
        WmsCustomerFile customerFile=null;
        //获取订单信息对象
        Map<String,Object> map1=(Map<String,Object>)map.get("head");
        wmsShipmentOrder.setId(UUIDUtils.uuid());
        //wms系统自己的仓库id
        wmsShipmentOrder.setCkid(String.valueOf(map.get("ckid")));
        //wms系统自己的货主id
        wmsShipmentOrder.setSshzid(String.valueOf(map.get("hzid")));
        //对方系统仓库编号
        wmsShipmentOrder.setDfckhb(String.valueOf(map1.get("whouse")));
        //8-17 新增 sono编号
        wmsShipmentOrder.setFybh(String.valueOf(map1.get("sono")));
        //8-17 新增 订单渠道编码
        if(!"".equals(map1.get("sectype")) && map1.get("sectype")!=null){
            String ddqdid = dao.getDdqdid(String.valueOf(map1.get("sectype")));
            wmsShipmentOrder.setDdqdid(ddqdid);
        }
        //8-17 新增 订单来源
        wmsShipmentOrder.setDdly(String.valueOf(map1.get("orderfrom")));
        //9_2新增店铺号

        if(!"".equals(map1.get("shopno")) && map1.get("shopno")!= null){
            wmsShipmentOrder.setShopno(String.valueOf(map1.get("shopno")));
        }else {
            wmsShipmentOrder.setShopno("");
        }
        //对方系统的货主编号
        wmsShipmentOrder.setDfhzbh(String.valueOf(map1.get("works")));
        //根据传入客户编码查询客户id
        if(!"".equals(map1.get("custno")) && map1.get("custno")!=null){
            WmsCustomerFile wmsCustomerFile=dao.selectKhbm(String.valueOf(map1.get("custno")));
            if(wmsCustomerFile!=null){
                wmsShipmentOrder.setKhid(wmsCustomerFile.getId());
            }else{
                customerFile = new WmsCustomerFile ();
                customerFile.setCkid(String.valueOf(map.get("ckid")));
                customerFile.setSshzid(String.valueOf(map.get("hzid")));
                customerFile.setId(UUIDUtils.uuid());
                customerFile.setKhbh(String.valueOf(map1.get("custno")));
                customerFile.setKhmc(String.valueOf(map1.get("custno")));
                customerFile.setDz(String.valueOf(map1.get("address")));
                customerFile.setSheng(String.valueOf(map1.get("state")));
                customerFile.setShi(String.valueOf(map1.get("city")));
                customerFile.setLxrxm(String.valueOf(map1.get("linkname")));
                customerFile.setLxrdh(String.valueOf(map1.get("phone")));
                wmsShipmentOrder.setKhid(customerFile.getId());
                //查库里默认线路集合(取库里第一个)
                List<WmsLine> lineList = dao.getXl(String.valueOf(map.get("ckid")),String.valueOf(map.get("hzid")));
                if( lineList != null &&  lineList.size()>0){
                    customerFile.setLxid(String.valueOf(lineList.get(0).getId()));
                }
                //添加保存客户档案
                dao.getAddCustomerFile(customerFile);

            }

        }
        //根据传入业务类型查询业务id
       /* if(!"".equals(map1.get("sectype")) && map1.get("sectype")!=null){
            String ywid=dao.selectYwlx(String.valueOf(map1.get("sectype")));
            wmsShipmentOrder.setBiztype(ywid);
        }*/
        //省
        wmsShipmentOrder.setSheng(String.valueOf(map1.get("state")));
        //市
        wmsShipmentOrder.setShi(String.valueOf(map1.get("city")));
        //县区
        wmsShipmentOrder.setXq(String.valueOf(map1.get("district")));
        //客户地址
        wmsShipmentOrder.setKhdz(String.valueOf(map1.get("address")));
        //联系人电话
        wmsShipmentOrder.setLxrdh(String.valueOf(map1.get("phone")));
        //联系人姓名
        wmsShipmentOrder.setLxrxm(String.valueOf(map1.get("linkname")));
        //备注
        wmsShipmentOrder.setBz(String.valueOf(map1.get("description")==null?"":map1.get("description")));
        //创建时间
        Date d=new Date();//获取时间
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//转换格式
        String time=sdf.format(d);
        wmsShipmentOrder.setCjsj(time);
        //要求交货时间
        wmsShipmentOrder.setYqjhsj(time);
        //计划交货时间
        wmsShipmentOrder.setJhfhsj(time);
        //wmsShipmentOrder.setXgsj(time);
        wmsShipmentOrder.setShzt("1");
        //区分提取还是创建
        wmsShipmentOrder.setAddlx(1);
        String ddlxid=dao.getDdlxs("销售出库单",wmsShipmentOrder.getCkid(),wmsShipmentOrder.getSshzid());
        wmsShipmentOrder.setFylx(ddlxid);
        //保存到发运订单表
        Integer save=dao.saveFy(wmsShipmentOrder);
        //获取发运明细集合
        List<Map<String,Object>> mapList= (List<Map<String, Object>>) map.get("detail");
        if(save>0){
            if(mapList.size()>0){
                WmsShipmentOrderDetailed wmsShipmentOrderDetailed=null;
                for(Map map2:mapList){
                    if(map1.get("sono").equals(map2.get("sono"))) {
                        wmsShipmentOrderDetailed = new WmsShipmentOrderDetailed();
                        wmsShipmentOrderDetailed.setId(UUIDUtils.uuid());
                        //发运订单id
                        wmsShipmentOrderDetailed.setSsfyddid(wmsShipmentOrder.getId());
                        //仓库
                        wmsShipmentOrderDetailed.setCkid(wmsShipmentOrder.getCkid());
                        //817 新增  qcstatus质检状态(合格不合格)
                        wmsShipmentOrderDetailed.setZjzt(String.valueOf(map2.get("qcstatus")));
                        //817 新增  zpquant(赠品数量)
                        if (String.valueOf(map2.get("zpquant")).indexOf(".") == -1) {
                            String zpsl = String.valueOf(map2.get("zpquant"));
                            wmsShipmentOrderDetailed.setZpsl(zpsl);
                        } else {
                            String zpsl = String.valueOf(map2.get("zpquant"));
                            String[] zpsls = zpsl.split(".");
                            wmsShipmentOrderDetailed.setZpsl(zpsls[0]);
                        }
                        //预期数量 set的也是文档里的数量,先判断是否包含".",包含截取后set
                        if (String.valueOf(map2.get("quant")).indexOf(".") == -1) {
                            String yqsl = String.valueOf(map2.get("quant"));
                            wmsShipmentOrderDetailed.setYqsl(yqsl);
                        } else {
                            //直接截取
                            String yqsl = String.valueOf(map2.get("quant"));
                            String[] yqsls = yqsl.split(".");
                            wmsShipmentOrderDetailed.setYqsl(yqsls[0]);
                        }
                        //用map里的matno (商品编码) 去查产品id
                        if (!"".equals(map2.get("matno")) && map2.get("matno") != null) {
                            List<WmsShipmentOrderDetailed> detailedList = dao.selectHpbm(String.valueOf(map2.get("matno")));
                            if (detailedList != null && detailedList.size() > 0) {
                                for (WmsShipmentOrderDetailed orderDetailed : detailedList) {
                                    if (!"".equals(orderDetailed.getHpid()) && orderDetailed.getHpid() != null) {
                                        if (orderDetailed.getBzlx().equals("0")) {
                                            wmsShipmentOrderDetailed.setHpid(orderDetailed.getHpid());
                                            if (!"".equals(orderDetailed.getZdw()) && orderDetailed.getZdw() != null) {
                                                wmsShipmentOrderDetailed.setZdw(orderDetailed.getZdw());
                                            } else {
                                                wmsShipmentOrderDetailed.setZdw("");
                                            }
                                        }
                                        if (!"0".equals(wmsShipmentOrderDetailed.getYqsl()) && !"".equals(wmsShipmentOrderDetailed.getYqsl()) && wmsShipmentOrderDetailed.getYqsl() != null) {
                                            if (orderDetailed.getBzlx().equals("2")) {
                                                if (!"0".equals(orderDetailed.getXzdwsl()) && !"".equals(orderDetailed.getXzdwsl()) && orderDetailed.getXzdwsl() != null) {
                                                    //箱单位整数
                                                    Integer xdwzs = Integer.parseInt(wmsShipmentOrderDetailed.getYqsl()) / Integer.parseInt(orderDetailed.getXzdwsl());
                                                    //箱单位余数
                                                    Integer xdwys = Integer.parseInt(wmsShipmentOrderDetailed.getYqsl()) % Integer.parseInt(orderDetailed.getXzdwsl());
                                                    String yqxdwsl = xdwzs + "箱" + xdwys + "件";
                                                    //箱件总数(xxx箱xx件)
                                                    wmsShipmentOrderDetailed.setYqxdwsl(yqxdwsl);
                                                } else {
                                                    wmsShipmentOrderDetailed.setYqxdwsl("0");
                                                }
                                            }
                                            //总金额
                                            if (orderDetailed.getBzlx().equals("0")) {
                                                if (!"0".equals(orderDetailed.getJe()) && !"".equals(orderDetailed.getJe())) {
                                                    wmsShipmentOrderDetailed.setLsje(String.valueOf(Double.parseDouble(wmsShipmentOrderDetailed.getYqsl()) * orderDetailed.getJe()));
                                                } else {
                                                    wmsShipmentOrderDetailed.setLsje("0");
                                                }
                                            }
                                        } else {
                                            wmsShipmentOrderDetailed.setYqxdwsl("0");
                                            wmsShipmentOrderDetailed.setLsje("0");
                                        }
                                    } else {
                                        throw new RuntimeException(String.valueOf(map2.get("matno")) + "，此货品不存在");
                                    }
                                }
                            } else {
                                throw new RuntimeException(String.valueOf(map2.get("matno")) + "，此货品不存在");
                            }
                        } else {
                            throw new RuntimeException(String.valueOf(map2.get("matno")) + "，此货品不存在");
                        }
                        //批号
                        wmsShipmentOrderDetailed.setPc(String.valueOf(map2.get("batch")));
                        //8_17新增行号
                        wmsShipmentOrderDetailed.setHh(String.valueOf(map2.get("lineno")));
                        //8_20新增对方货主编号
                        wmsShipmentOrderDetailed.setDfhzbh(String.valueOf(map2.get("works")));
                        //8_20新增对方仓库编号
                        wmsShipmentOrderDetailed.setDfckhb(String.valueOf(map2.get("whouse")));
                        //9_2新增 总积分 总折扣 产品编码(不是产品表里的编号,内部用的,直接保存)
                        if(!"".equals(map2.get("totalscore")) && map2.get("totalscore")!= null){
                            wmsShipmentOrderDetailed.setTotalscore(String.valueOf(map2.get("totalscore")));
                        }else {
                            wmsShipmentOrderDetailed.setTotalscore("");
                        }
                        if(!"".equals(map2.get("totaldiscount")) && map2.get("totaldiscount")!= null){
                            wmsShipmentOrderDetailed.setTotaldiscount(String.valueOf(map2.get("totaldiscount")));
                        }else {
                            wmsShipmentOrderDetailed.setTotaldiscount("");
                        }
                        if(!"".equals(map2.get("pcode")) && map2.get("pcode")!= null){
                            wmsShipmentOrderDetailed.setPcode(String.valueOf(map2.get("pcode")));
                        }else {
                            wmsShipmentOrderDetailed.setPcode("");
                        }


                        //备注
                        wmsShipmentOrderDetailed.setMxbz(String.valueOf(map2.get("description")));
                        wmsShipmentOrderDetailed.setCjsj(time);
                        //保存发运订单明细
                        Integer j = dao.saveFyDetailed(wmsShipmentOrderDetailed);
                        if (j <= 0) {
                            throw new RuntimeException("新增发运订单明细失败");
                        }
                    }else {
                        throw new RuntimeException("出库单主信息单号和明细信息单号不匹配");
                    }
                }
            }
            //调取承运商选择接口
            JSONObject object=getForwardingAgent(String.valueOf(map1.get("sono")));
            if(object.get("cyslb")!=null && !"".equals(object.get("cyslb"))){
                wmsShipmentOrder.setCyslb(String.valueOf(object.get("cyslb")));
                dao.updateCyslb(wmsShipmentOrder);
            }
            throw new SucessException("新增发运订单成功");
        }else {
            throw new RuntimeException("新增发运订单失败");
        }
    }
    /**
     * 根据传入订单号判断是否存在重复
     * */
    public WmsShipmentOrder selectSfRepetition(String sono){
        return dao.selectSfRepetition(sono);
    }
    //<!-----------------------主动调用接口-------------------------->
    /**
     * 领料出库单下发接口 对接前台显示数据
     * */
    public WmsShipmentOrder getSeachFydd(JSONObject jsonObject, WmsShipmentOrder wmsShipmentOrder) throws Exception{
        if(!"".equals(jsonObject.get("backcode")) && jsonObject.get("backcode")!=null && jsonObject.get("backcode").toString().equals(-1)) {
            throw new ServiceException("获取发运订单数据失败");
        }
        //解析json
        JsonParser parse =new JsonParser();
        JSONObject json=JSONObject.fromObject(jsonObject.get("backhead"));
        //JsonObject json=(JsonObject) parse.parse(new FileReader(jsonObject.get("backhead").toString()));
        //发运编号
        wmsShipmentOrder.setFybh(String.valueOf(json.get("sono")));
        //订单类型
        WmsOwnerOrdertype wmsOwnerOrdertype=dao.selectDdlx(String.valueOf(json.get("sotype")),"1");
        wmsShipmentOrder.setShow_fylx(wmsOwnerOrdertype.getDdlx());
        wmsShipmentOrder.setSotype(String.valueOf(json.get("sotype")));
        wmsShipmentOrder.setFylx(wmsOwnerOrdertype.getId());

        return wmsShipmentOrder;
    }
    /**
     * 领料出库单下发接口
     * */
    public void Add(JSONObject json,WmsShipmentOrder wmsShipmentOrder) throws SucessException {
        //获取发运订单对象
        JSONObject jsonObject=JSONObject.fromObject(json.get("backhead"));
        //备注
        wmsShipmentOrder.setBz(String.valueOf(jsonObject.get("description")));
        //订单完成日期
        wmsShipmentOrder.setCjsj(String.valueOf(jsonObject.get("enddate")));
        getAddFydd(jsonObject,wmsShipmentOrder,json);
    }
    /**
     * 添加发运订单及明细
     * */
    public void getAddFydd(JSONObject jsonObject,WmsShipmentOrder wmsShipmentOrder,JSONObject json) throws SucessException {
        wmsShipmentOrder.setId(UUIDUtils.uuid());
        //仓库id
        wmsShipmentOrder.setCkid(String.valueOf(jsonObject.get("whouse")));
        //货主id
        wmsShipmentOrder.setSshzid(String.valueOf(jsonObject.get("works")));
        //发运编号
        wmsShipmentOrder.setFybh(String.valueOf(jsonObject.get("sono")));
        //订单类型
        WmsOwnerOrdertype wmsOwnerOrdertype=dao.selectDdlx((String.valueOf(jsonObject.get("sotype"))),"1");
        wmsShipmentOrder.setFylx(wmsOwnerOrdertype.getId());
        //数据类别 1为获取
        wmsShipmentOrder.setType(1);
        //备注
        wmsShipmentOrder.setBz(String.valueOf(jsonObject.get("description")));
        //客户订单号
        wmsShipmentOrder.setKhddh(String.valueOf(jsonObject.get("sono")));
        //数据是否返回
        wmsShipmentOrder.setBack(jsonObject==null?0:1);
        //返回信息
        wmsShipmentOrder.setBackmsg(json.get("backmsg").toString());
        //创建人
        wmsShipmentOrder.setCjr(wmsShipmentOrder.getCjr());
        //保存发运订单
        Integer save=dao.saveFy(wmsShipmentOrder);
        //获取发运明细
        List<Map<String,Object>> maps= JSONArray.fromObject(json.get("backdetail").toString()) ;
        //如果发运订单添加成功
        if(save>0){
            if(maps.size()>0){
                WmsShipmentOrderDetailed wmsShipmentOrderDetailed=null;
                for(Map map:maps){
                    wmsShipmentOrderDetailed =new WmsShipmentOrderDetailed();
                    wmsShipmentOrderDetailed.setId(UUIDUtils.uuid());
                    //发运id
                    wmsShipmentOrderDetailed.setSsfyddid(wmsShipmentOrder.getId());
                    //批号
                    wmsShipmentOrderDetailed.setPc(String.valueOf(map.get("batch")));
                    //仓库id
                    wmsShipmentOrderDetailed.setCkid(String.valueOf(map.get("whouse")));
                    /*String hpid=dao.selectHpbm(String.valueOf(map.get("matno")));
                    wmsShipmentOrderDetailed.setHpid(hpid);*/
                    //用map里的matno (商品编码) 去查产品id
                   /* if(!"".equals(map.get("matno")) && map.get("matno")!=null){
                        WmsShipmentOrderDetailed shipmentOrderDetailed=dao.selectHpbm(String.valueOf(map.get("matno")));
                        if(!"".equals(shipmentOrderDetailed.getHpid())&&shipmentOrderDetailed.getHpid()!=null){
                            wmsShipmentOrderDetailed.setHpid(shipmentOrderDetailed.getHpid());
                            wmsShipmentOrderDetailed.setZdw(shipmentOrderDetailed.getZdw());
                        }else{
                            throw new RuntimeException("该货品不存在");
                        }
                    }else{
                        throw new RuntimeException("该货品不存在");
                    }*/
                    if(!"".equals(map.get("matno")) && map.get("matno")!=null){
                        List<WmsShipmentOrderDetailed> detailedList=dao.selectHpbm(String.valueOf(map.get("matno")));
                        if(detailedList!=null && detailedList.size()>0){
                            for(WmsShipmentOrderDetailed  orderDetailed:detailedList){
                                wmsShipmentOrderDetailed.setHpid(orderDetailed.getHpid());
                                wmsShipmentOrderDetailed.setZdw(orderDetailed.getZdw());
                            }
                        }else{
                            throw new RuntimeException("该货品不存在");
                        }
                    }else{
                        throw new RuntimeException("该货品不存在");
                    }
                    //保存发运明细
                    Integer save2=dao.saveFyDetailed(wmsShipmentOrderDetailed);
                    if(save2<=0){
                        throw new RuntimeException("新增发运明细失败");
                    }
                }
            }
            throw new SucessException("新增发运订单成功");
        }else{
            throw new SucessException("新增发运订单失败");
        }
    }
    /**
     * 根据发运编号和订单类型查询数据
     * */
    public WmsShipmentOrder getSelectBh(String sono,String sotype){
        return dao.getSelectBh(sono,sotype);
    }
    /**
     * 查询订单类型接口
     * */
    public List<WmsOwnerOrdertype> getDdlx(String ckid,String sshzid) throws ServiceException {
        try {

            List<WmsOwnerOrdertype> list =new ArrayList<>();
            list = dao.getDdlx(ckid,sshzid);
            return list;
        } catch (Exception e) {
            throw new ServiceException("订单类型模糊查询信息",e);
        }
    }
}
